﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            string []cats =new string[] {"interest", "copper", "oilseed", "sugar", "grain"};
            StreamReader stringReader = new StreamReader(@"C:\ParsingTest\CategorySubset.txt");
            StreamWriter sw = new StreamWriter(@"C:\ParsingTest\CategorySubset_new.txt");
            while (!stringReader.EndOfStream)
            {
                string line = stringReader.ReadLine();
                foreach (string cat in cats)
                {
                    if (line.Trim().EndsWith(cat))
                    {
                        sw.WriteLine(line);
                        break;
                    }
                }
            }
            stringReader.Close();
            sw.Close();

        }
    }
}
